
<script src="../../../../../yuc/static/js/public.js"></script>{extend name="common/form" /}
{block name="form" /}
<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
    <div class="widget am-cf">
        <div class="widget-head am-cf">
            <div class="widget-title am-fl">{$info.true_name}:{$info.telephone}</div>
        </div>
        <div class="widget-body am-fr">
            <form class="am-form tpl-form-border-form tpl-form-border-br">
                <input type="hidden" name="id" value="{$info.id}">
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">
                        是否是业务员                    </label>
                    <div class="am-u-sm-9">
                        <div class="tpl-switch">
                            <input type="checkbox" name="is_salesman"  class="ios-switch bigswitch tpl-switch-btn am-margin-top-xs" {present name='$info.is_salesman'}{eq name='$info.is_salesman' value="1"}checked{/eq} {/present}>
                            <div class="tpl-switch-btn-view">
                                <div></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">
                        团队级别
                    </label>
                    <div class="am-u-sm-9">
                        <div class="tpl-switch">
                            <select name="user_job_id" required="required" data-am-selected="{searchBox: 2}">
                                {foreach $job_list as $v}
                                    {if $v.id >= $info.user_job_id}
                                        {php}
                                        if(getConfig('best_id')<$v['id'])break;
                                        {/php}
                                    <option value="{$v.id}" {notempty name='$info.user_job_id'}{eq name="$info.user_job_id" value="$v.id"}selected{/eq}{/notempty}>{$v.name}</option>
                                    {/if}
                                {/foreach}
                            </select>
                        </div>
                    </div>
                </div>
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">
                        联通工号                    </label>
                    <div class="am-u-sm-9">
                        <input type="text" name="text" value="{present name='$info.number'}{$info.number}{/present}" class="tpl-form-input" placeholder="请填写联通工号">
                    </div>
                </div>
               <!-- <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">
                        到期时间
                    </label>
                    <div class="am-u-sm-9">
                        <input type="text" readonly name="text" value="{present name='$info.number'}{$info.number}{/present}" class="tpl-form-input" data-am-datepicker="{format: 'yyyy-mm-dd', viewMode: 'months'}" placeholder="请填写联通工号">
                    </div>
                </div>-->
                <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">
                        到期时间
                    </label>
                    <div class="am-u-sm-9">
                        <input type="radio" name="job_time" checked value="90" class="ios-switch bigswitch tpl-switch-btn am-margin-top-xs">
                        90天
                        <input type="radio" name="job_time" value="180" class="ios-switch bigswitch tpl-switch-btn am-margin-top-xs">
                        180天

                    </div>
                </div>
              <!--  <div class="am-form-group">
                    <label for="user-name" class="am-u-sm-3 am-form-label">
                        登录状态
                    </label>
                    <div class="am-u-sm-9">
                        <div class="tpl-switch">
                            <input type="checkbox" name="lock"  class="ios-switch bigswitch tpl-switch-btn am-margin-top-xs" {present name='$info.lock'}{eq name='$info.lock' value="1"}checked{/eq} {else}checked{/present}>
                            <div class="tpl-switch-btn-view">
                                <div></div>
                            </div>
                        </div>
                    </div>
                </div>-->
                <div class="am-form-group">
                    <div class="am-u-sm-9 am-u-sm-push-3">
                        <button type="button" onclick="add('{:url($type)}','form')" class="am-btn am-btn-primary tpl-btn-bg-color-success" >
                            提交
                        </button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name='script'}
<script type="text/javascript">
    function getNext(dom) {
        var id = parseInt($(dom).attr('type'));
        var nextDom = $('select[data-type="type_'+(id+1)+'"]');
        if(dom.value ==0){
            nextDom.next('br').remove();
            nextDom.remove();
        }
        $.get("{:url('operate/getNextOperate')}",{id:dom.value},function (result) {
            var htm= '';
            if(result.length ==0){
                nextDom.next('br').remove();
                nextDom.remove();
                return;
            }
            for(var i=0;i<result.length;i++){
                htm+='<option value="'+result[i].id+'">'+result[i].name+'</option>'
            }
            if(nextDom.get(0) ==undefined){
                htm = "<select style='margin-top: 10px;' name='parent_id' data-type='type_"+(id+1)+"' type='"+(id+1)+"'  onchange=\"getNext(this)\">"+htm+"</select>"
                $('#yunyin').append(htm)
            }else{
                nextDom.html(htm)
            }
        },'json')
    }
</script>
{/block}
{extend}
